package com.demo.project.entity;

import com.demo.project.utils.StringUtils;
import lombok.Data;
import java.time.LocalDate;
import java.util.ArrayList;
import java.util.List;

@Data
public class Team {
    private String id;// team id
    private String initiatorId;//发起人id
    private String departure;
    private String destination;
    private LocalDate start;
    private LocalDate end;
    private String teamDesc;// 队伍描述信息
    private Integer needNumber;
    private Integer totalTeamNumber;
    private List<String> teamMembers = new ArrayList<>();//uids

    public Team() {
        id =StringUtils.getRandomId();
    }

    public void participate(String uid){
        teamMembers.add(uid);
    }
    public void exitTeam(String uid){
        teamMembers.remove(uid);
    }
    public void closeTeam(){
        teamMembers.clear();
    }


}
